﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace WebApplication5.Migrations
{
    public partial class init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "administrators",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false),
                    Name = table.Column<string>(maxLength: 50, nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_administrators", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Course",
                columns: table => new
                {
                    CourseId = table.Column<string>(nullable: false),
                    CourseName = table.Column<string>(maxLength: 50, nullable: false),
                    Credit = table.Column<int>(nullable: false),
                    Period = table.Column<int>(nullable: false),
                    CourseNature = table.Column<string>(nullable: true),
                    CourseProperties = table.Column<string>(nullable: true),
                    Inspect = table.Column<string>(nullable: true),
                    TestWeight = table.Column<int>(nullable: false),
                    UsualWeight = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Classes", x => x.CourseId);
                });

            migrationBuilder.CreateTable(
                name: "colledes",
                columns: table => new
                {
                    CollegeId = table.Column<string>(nullable: false),
                    CollegeName = table.Column<string>(nullable: true),
                    StuNumber = table.Column<int>(nullable: false),
                    TeachNumber = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_colledes", x => x.CollegeId);
                });

            migrationBuilder.CreateTable(
                name: "jurisdictions",
                columns: table => new
                {
                    DateTime = table.Column<DateTime>(nullable: false),
                    SystemState = table.Column<string>(nullable: true),
                    CourseSelectState = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_jurisdictions", x => x.DateTime);
                });

            migrationBuilder.CreateTable(
                name: "systemLogs",
                columns: table => new
                {
                    LogId = table.Column<string>(nullable: false),
                    Changes = table.Column<string>(nullable: true),
                    Time = table.Column<string>(nullable: true),
                    Executor = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_systemLogs", x => x.LogId);
                });

            migrationBuilder.CreateTable(
                name: "teachers",
                columns: table => new
                {
                    AccountNumber = table.Column<string>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_teachers", x => x.AccountNumber);
                });

            migrationBuilder.CreateTable(
                name: "users",
                columns: table => new
                {
                    AccountNumber = table.Column<string>(nullable: false),
                    Password = table.Column<string>(nullable: true),
                    Identity = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_users", x => x.AccountNumber);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "administrators");

            migrationBuilder.DropTable(
                name: "Classes");

            migrationBuilder.DropTable(
                name: "colledes");

            migrationBuilder.DropTable(
                name: "jurisdictions");

            migrationBuilder.DropTable(
                name: "systemLogs");

            migrationBuilder.DropTable(
                name: "teachers");

            migrationBuilder.DropTable(
                name: "users");
        }
    }
}
